home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0189.ZIP / FILER.DOC < prev    next >
Text File  |  1986-02-08  |  83KB  |  2,373 lines

  1.  
  2.  
  3.  
  4.                                                       JULY 3,1985
  5.  
  6.                      FILER GROUP OF PROGRAMS
  7.                      =======================
  8.  
  9.  
  10.    The FILER GROUP of programs permit the creation,  maintenance,
  11. and use of very large data files.  These programs are written  in
  12. Turbo Pascal for PCDOS Microcomputer systems. ( CP/M versions are
  13. also  available ) The programs which compose the FILER GROUP  are
  14. FILER,   SORTER,   PICTOFRM,  FRMTODAT,  DATTOPIC,  STARTER,  and
  15. TRANSFER.
  16.  
  17.  
  18.    PICTOFMR  permits  the translation of a picture of  a  desired
  19. data  base screen to be translated into an intermediate form that
  20. records locations,  data types, and label names. The intermediate
  21. file  form permits the order of data entry to be modified to  any
  22. desired sequence.
  23.  
  24.  
  25.    FRMTODAT permits the rapid conversion of the file generated by
  26. PICTOFRM into an empty (null) FILER FILE.
  27.  
  28.  
  29.    DATTOPIC  permits the generation of a file which contains  the
  30. screen  picture of the file from a FILER FILE.  This file can  be
  31. printed or edited for record or modification purposes.
  32.  
  33.  
  34.    FILER permits the user to display,  add,  correct,  or  delete
  35. data records from the disk file.
  36.  
  37.  
  38.    SORTER permits the user to sort records within a file on up to
  39. ten  of  the fields which make up the data record.  This  program
  40. renames the source data by changing its file extension to  "BAK".
  41. A new sorted file, with the extension "DAT", is created. REQUIRES
  42. THE FILE SORT.BOX FROM BORLAND'S TURBO TOOLBOX. A compiled version
  43. of SORTER is included. (PC-DOS version)
  44.  
  45.  
  46.    STARTER  is  a source program written in Turbo  Pascal  source
  47. which contains all the logic to access a disk file, read records,
  48. print out data field labels and the data contained in each  field
  49. of  a  data  record.  Provision is also made  for  page  control,
  50. titles, sub totals and grand totals.
  51.  
  52.  
  53.    TRANSFER is a program which permits data to be moved from  any
  54. existing  FILER  FILE  to  a  newly defined  FILER  FILE  with  a
  55. different file organization.  The creation of a TRANSLATION TABLE
  56. makes  it possible to transfer data from any SOURCE FIELD to  any
  57. desired DESTINATION FIELD.  This program makes possible the rapid
  58. revision of any FILER FILE to a new format.
  59.  
  60.  
  61.  
  62.                                 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.                  CREATING A FILER DATABASE FILE.
  72.                  ===============================
  73.  
  74.  
  75.   CREATING A FILER DATABASE FILE IS A EASY PROCESS.  FIRST,  WITH
  76. A TEXT EDITOR,  ENTER A PICTURE OF THE FILE TO BE  CREATED.  GIVE
  77. THE  FILE A MEANINGFUL NAME AND USE THE FILE EXTENSION ".PIC"  SO
  78. THAT IT CAN BE EASILY IDENTIFIED AS THE "PICTURE" OF THE FILE  TO
  79. BE  CREATED.  FOR EXAMPLE,  AN ACCOUNTS RECEIVABLE FILE MIGHT  BE
  80. NAMED  "ACCTREC.PIC." FOR NOW,  THE GENERAL NAME "FILENAME.PIC",
  81. WILL BE USED.
  82.  
  83.  
  84.   EXIT  THE EDITOR,  RETURN TO THE DISK OPERATING SYSTEM AND  RUN
  85. THE  PROGRAM  "PICTOFRM".  "PICTOFRM"  IS SHORT FOR  "PICTURE  TO
  86. FORM",  WHICH DESCRIBES WHAT THE PROGRAM DOES. THE PICTURE OF THE
  87. FILE WILL BE EXAMINED AND A FORM WILL BE CREATED WHICH  TABULATES
  88. THE LOCATION, TYPE (ALPHA OR NUMERIC), DATA LENGTH, AND THE LABEL
  89. FOR  EACH FIELD.  DATA FIELDS ARE LISTED IN THE ORDER ENCOUNTERED
  90. IN THE PICTURE:  FROM LEFT TO RIGHT AND FROM TOP LINE TO  BOTTOM.
  91. THE  FILE  GENERATED BY THIS STEP WILL HAVE THE SAME NAME AS  THE
  92. PICTURE OF THE FILE WITH THE FILE EXTENSION CHANGED TO ".FRM".
  93.  
  94.  
  95.   FILER WILL EVENTUALLY STEP THRU THE FIELDS OF THE RECORD IN THE
  96. ORDER THAT THEY ARE LISTED IN THE "FILENAME.FRM" FILE. THIS ORDER
  97. MAY  BE CHANGED BY EDITING THE FILE WITH YOUR EDITOR.  USE  BLOCK
  98. MOVES  AND  MOVE WHOLE LINES OF THE FORM UNTIL THE DESIRED  FIELD
  99. SEQUENCE IS OBTAINED. DO NOT CHANGE THE RELATIVE POSITION OF DATA
  100. WITHIN THE LINES.
  101.  
  102.  
  103.   RETURN  TO  THE  DISK  OPERATING SYSTEM  AND  RUN  THE  PROGRAM
  104. "FRMTODAT".  "FRMTODAT",  WHICH IS SHORT FOR "FORM TO DATA", WILL
  105. USE FILENAME.FRM AS SOURCE DATA AND WILL CREATE A FILER FILE WITH
  106. THE NAME FILENAME.DAT. THIS FILE IS A NULL (EMPTY) VERSION OF THE
  107. FILE AND MAY BE USED BY ALL THE FILER GROUP OF PROGRAMS.
  108.  
  109.  
  110.   A LAST PROGRAM, "DATTOPIC", IS AVAILABLE TO CREATE A PICTURE OF
  111. THE FILE FROM A FILER GROUP FILE.  "DATTOPIC", WHICH IS SHORT FOR
  112. DATA  TO  PICTURE WILL USE FILENAME.DAT AS SOURCE DATA  AND  WILL
  113. CREATE  A  PICTURE OF THE FILE WITH THE NAME  FILENAME.PIC.  THIS
  114. PROGRAM  IS USEFUL WHEN YOU HAVE AS EXISTING FILER FILE  AND  THE
  115. SOURCE MATERIAL IS NOT READILY AVAILABLE.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                 2
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.               EXAMPLE OF CREATING A DATABASE FILE.
  138.  
  139. USE ANY EDITOR THAT WILL PRODUCE CLEAN TEXT WITHOUT EMBEDDED, NON
  140. PRINTABLE CHARACTERS.  YOUR TURBO EDITOR WILL WORK FINE. ENTER
  141. THE  DATA LABELS AND DATA FIELDS JUST AS THEY WILL APPEAR ON  THE
  142. FIRST  22  LINES OF THE SCREEN.  LINES 23 & 24 ARE  RESERVED  FOR
  143. USE BY FILER.  A SAMPLE MAIL ADDRESS FILE MIGHT LOOK LIKE THIS:
  144.  
  145. NAME  : AAAAAAAAAAAAAAAAAAAA
  146. ADDR1 : AAAAAAAAAAAAAAAAAAAA
  147. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  148. CITY  : AAAAAAAAAAAAAAAAA
  149. STATE : AA   ZIPCODE : AAAAA
  150.  
  151. A FEW RULES TO MAKE THINGS GO SMOOTHLY:
  152.  
  153.   FIRST,  ALWAYS  ENTER THE LABEL OF THE DATA FIELD FIRST AND END
  154.   IT  WITH A ':' SO THAT THE PROGRAM KNOWS WHERE THE  LABEL  ENDS
  155.   AND THE DATA FIELD BEGINS.
  156.  
  157.   SECOND, A SPACE BEFORE AND AFTER THE ':' KEEPS THE DATA EASY TO
  158.   READ.
  159.  
  160.   THIRD,  DEFINE THE FIELD WHERE DATA WILL BE ENTERED BY ENTERING
  161.   A  SERIES  OF  ANY ALPHA CHARACTER.  THE  EXAMPLE  USES  AAAA'S
  162.   BECAUSE  THE DATA IS ALPHA,  BUT IT COULD HAVE BEEN ALMOST  ANY
  163.   OTHER  CHARACTER EXCEPT THOSE DIGITS AND CHARACTERS WE  USUALLY
  164.   USE TO DISPLAY NUMBERS. SO 0,1,2,3,4,5,6,7,8,9,$,.,+,-, AND THE
  165.   COMMA AND UNDERLINE (_) ARE ONLY USED FOR NUMBERS. MORE ON THAT
  166.   SHORTLY.
  167.  
  168.   FOURTH,  THE FIRST SPACE FOLLOWING THE DATA FIELD INDICATES THE
  169.   END OF THE DATA ENTRY FIELD.
  170.  
  171.   FIFTH,  A  MAXIMUM  OF 31 LABELS MAY BE USED IN A  FILER  FILE.
  172.   MORE, AND THE FIELD DEFINITION WILL GET LOST.
  173.  
  174. NOW,  EXAMINE A FILE DEFINITION WHICH CONTAINS NUMERIC VALUES. IN
  175. A NUMERIC FIELD,  A NUMBER ENTERED WILL BE EDITED WITH COMMAS AND
  176. RIGHT JUSTIFIED IN THE FIELD. LEADING ZEROS WILL BE REPLACED WITH
  177. LEADING  SPACES  AND  A DEFINED NUMBER OF  DIGITS  FOLLOWING  THE
  178. DECIMAL  PLACE WILL BE SHOWN.  ASCII FIELDS CAN  HOLD NUMBERS - A
  179. TELEPHONE  NUMBER IS A GOOD EXAMPLE - BUT THE VALUE ENTERED  WILL
  180. BE  TREATED  AS THOUGH IT WAS ALPHA TEXT  AND  DISPLAYED  WITHOUT
  181. EDITING OR JUSTIFICATION.
  182.  
  183. ENTER THE DATA LABELS AND NUMERIC DATA FIELDS JUST AS THEY SHOULD
  184. APPEAR  ON THE FIRST 22 LINES OF THE SCREEN.  A  SAMPLE  ACCOUNTS
  185. RECEIVABLE FILE MIGHT LOOK LIKE THIS:
  186.  
  187. NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  188. ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  189. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  190. CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  191. STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  192.  
  193.  
  194.                                 3
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  205. ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  206. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  207. CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  208. STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  209.  
  210. NOW, MORE RULES FOR NUMBERS:
  211.  
  212.   FIRST,  USE  ONLY DIGITS OR THE UNDERLINE CHARACTER TO  DISPLAY
  213.   THE DATA FIELD.  IF ANY ALPHA CHARACTER IS ENTERED, THE PROGRAM
  214.   WILL TREAT THE DATA FIELD AS ALPHA.
  215.  
  216.   SECOND,  USE  COMMAS IN YOUR NUMERIC FIELDS WHERE  APPROPRIATE.
  217.   THE  NUMBER  OF CHARACTERS IN THE FIELD,  LESS  THE  NUMBER  OF
  218.   COMMAS  IS  USED  TO  DETERMINE THE AMOUNT  OF  MEMORY  STORAGE
  219.   REQUIRED FOR THAT NUMERIC FIELD.
  220.  
  221.   THIRD,  IF A NUMBER IS NEGATIVE,  IT WILL DISPLAY AS A  LEADING
  222.   MINUS SIGN AND CAN REDUCE THE NUMERIC DISPLAY BY ONE CHARACTER.
  223.  
  224.   FOURTH, THE UNDERLINE CHARACTER CAN BE USED TO DEFINE A NUMERIC
  225.   FIELD  SO  THAT THE AMOUNT PAST DUE FIELD COULD BE  ENTERED  AS
  226.   ___,___.__ INSTEAD OF AS 123,456.78.
  227.  
  228. WHEN  THE  PICTURE OF THE DATABASE FILE HAS BEEN COMPLETED, WRITE
  229. THE FILE TO DISK USING THE FILE NAME "ACCTREC.PIC".   THE ".PIC"
  230. FILE EXTENSION IDENTIFIES THE FILE AS A PICTURE OF THE FILE TO BE
  231. CREATED.  FROM  THIS POINT,  THE PROCESS OF CREATING A DATA  BASE
  232. FILE FOR FILER IS A TWO STEP PROCESS:
  233.  
  234.   FIRST,  RUN THE PROGRAM "PICTOFRM" AND USING "ACCTREC.PIC",THE
  235. PICTURE  FILE  JUST CREATED.  THE OUTPUT OF THIS PROGRAM WILL  BE
  236. ANOTHER FILE WITH THE NAME "ACCTREC.FRM".  "ACCTREC.FRM" IS  AN
  237. ASCII  FILE THAT CAN BE READ WITH YOUR TEXT EDITOR.  IF  DESIRED,
  238. THE  CONTENTS OF THE FILE CAN BE EDITED TO REARRANGE THE ORDER IN
  239. WHICH  THE  FIELDS  IN  THE RECORD ARE  DISPLAYED  BY  THE  FILER
  240. PROGRAM.
  241.  
  242.   NUMERIC  FIELDS  CAN HOLD VERY LARGE AND VERY  SMALL  NUMBERS--
  243. PROBABLY LARGER AND SMALLER THAN ARE USUALLY NEEDED.  THE LARGEST
  244. NUMBER IS 99,999,999,999 AND HAS 11 NUMERIC DIGITS. LARGER FIELDS
  245. CAN BE SPECIFIED, BUT TURBO PASCAL CAN NOT HOLD DATA TO A GREATER
  246. PRECISION AND DATA WILL BE ROUNDED OFF TO 11 NUMERIC DIGITS.  THE
  247. SMALLEST  NUMBER  THAT CAN BE DISPLAYED IS 0.00000001 AND  HAS  8
  248. DIGITS  TO THE RIGHT OF THE DECIMAL POINT.  ATTEMPTS TO SPECIFY A
  249. FIELDS  WITH  9 DECIMAL DIGITS WILL CAUSE SPURIOUS DIGITS  TO  BE
  250. DISPLAYED...  ALTHOUGH THE DATA IS PROBABLY STILL CORRECT. FIELDS
  251. WHICH CONTAIN NUMBERS TO THE RIGHT AND LEFT OF THE DECIMAL  POINT
  252. SHOULD BE LIMITED TO A MAXIMUM OF 12 NUMERIC DIGITS. FOR EXAMPLE,
  253. THE FIELD 12,345.1234567 WORKS OK.  IF YOU HAVE ANY DOUBT ABOUT A
  254. PARTICULAR  COMBINATION,  TRY IT AND SEE IF IT WORKS IN THE FINAL
  255. FILER FILE!
  256.  
  257.  
  258.  
  259.  
  260.                                 4
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269. THE  USE OF THE PROGRAM "PICTOFRM" ON ACCTREC.PIC GENERATES  THE
  270. FOLLOWING RESULTS:
  271.  
  272.  
  273.     "PICTOFRM" CONVERTS FILES FROM XXX.PIC TO XXX.FRM.
  274.     ENTER FILENAME OF PICTURE FILE :  ACCTREC
  275.  
  276.     NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  277.     ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  278.     ADDR2 : AAAAAAAAAAAAAAAAAAAA
  279.     CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  280.     STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  281.  
  282.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  283.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  284.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  285.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  286.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  287.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  288.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  289.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  290.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  291.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  292.  
  293.     ENTER ANY KEY TO CONTINUE
  294.  
  295.     BEGINNING  WITH  A  PICTURE  OF  THE  FILE,   "PICTOFRM"  HAS
  296.     TRANSLATED  THIS  INFORMATION INTO AN INTERMEDIATE  FORM  AND
  297.     STORED IT IN A FILE WITH THE SAME NAME AND THE FILE EXTENSION
  298.     ".FRM".
  299.  
  300.     THIS FILE MAY NOW BE EDITED WITH ANY EDITOR SUCH AS WORDSTAR
  301.     TO REVISE THE ORDER OF THE FIELDS IN THE FILE.
  302.  
  303.     FINALLY, TO CONVERT THE ".FRM" INTERMEDIATE FILE INTO A ".DAT"
  304.     FILE THAT CAN BE USED BY THE FILER GROUP OF PROGRAMS, USE THE
  305.     PROGRAM "FRMTODAT".
  306.  
  307.     RECORD LENGTH : 112 BYTES
  308.     BLOCKING FACTOR : 2
  309.     BYTES LEFT IN BLOCK : 32
  310.     CHANGE RECORD LENGTH BY -27 BYTES TO INCREASE BLOCKING FACTOR
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                 5
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. THE FILER PROGRAM WILL ULTIMATELY STEP THROUGH THE FIELDS OF  THE
  336. RECORD  IN  THE  ORDER THAT THE FIELDS WERE  ENCOUNTERED  IN  THE
  337. PICTURE  STARTING FROM TOP AND PROCESSING EACH LINE FROM LEFT  TO
  338. RIGHT. THIS WILL GIVE THE FOLLOWING ORDER:
  339.  
  340.      LABEL >NAME  <
  341.      LABEL >ACCOUNT REC  <
  342.      LABEL >ADDR1 <
  343.      LABEL >AMT PAST DUE <
  344.      LABEL >ADDR2 <
  345.      LABEL >CITY <
  346.      LABEL >AREA CODE <
  347.      LABEL >STATE <
  348.      LABEL >ZIPCODE <
  349.      LABEL >PHONE NBR <
  350.  
  351. THIS  ORDER MAY BE MODIFIED BY USING A TEXT EDITOR AND MOVING THE
  352. LINES TO THE ORDER DESIRED.  FOR EXAMPLE,  TO PLACE THE  "ACCOUNT
  353. REC"  AND  "AMT PAST DUE" AT THE END AFTER THE NAME  AND  ADDRESS
  354. INFORMATION, EDIT THE ACCTREC.FRM FILE AS FOLLOWS:
  355.  
  356.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  357.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  358.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  359.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  360.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  361.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  362.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  363.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  364.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  365.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  366.  
  367. NOTICE  IN PARTICULAR HOW THE LINES FOR ACCOUNT REC AND AMT  PAST
  368. DUE HAVE BEEN RELOCATED FROM THE ORIGINAL  ACCTREC.FRM.
  369.  
  370. THE CONTENTS OF THE ACCTREC.FRM FILE HAVE THE FOLLOWING MEANINGS:
  371.  
  372.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  373.       \        \       \        \        \               \
  374.        \        \       \        \        \               \__ FIELD LABEL
  375.         \        \       \        \        \__ MISC FIELD (NOT USED)
  376.          \        \       \        \__ LENGTH OF DATA FIELD (MAX 60 CHAR)
  377.           \        \       \__ FORM OF THE DATA FIELD:
  378.            \        \            15 = ASCII (ALPHA) DATA
  379.             \        \           0  = NUMERIC DATA WITH NO DECIMAL DIGITS
  380.              \        \          1  = NUMERIC DATA WITH 1 DECIMAL DIGITS
  381.               \        \         2  = NUMERIC DATA WITH 2 DECIMAL DIGITS
  382.                \        \        N  = NUMERIC DATA WITH N DECIMAL DIGITS
  383.                 \        \       14 = NUMERIC DATA WITH 14 DECIMAL DIGITS
  384.                  \        \__ COLUMN OF FIRST CHARACTER OF FIELD LABEL
  385.                   \__ ROW OF FIRST CHARACTER OF FIELD LABEL
  386.  
  387. Information  in the "FRM" file may be edited to change  position,
  388. data form,  field length, and label name. It is only necessary to
  389. ensure that the original column spacing is maintained.
  390.  
  391.  
  392.                                 6
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.   FINALLY,  TO  CREATE THE FINAL ".DAT" FORM OF THE FILE THAT CAN
  402. BE  ACCESSED  BY THE FILER GROUP OF  PROGRAMS,  RUN  THE  PROGRAM
  403. "FRMTODAT".  THE OUTPUT OF THIS PROGRAM IS A FILER DATA FILE WITH
  404. THE NAME "ACCTREC.DAT".
  405.  
  406.     "FRMTODAT" CONVERTS FILE FROM XXX.FRM TO XXX.DAT
  407.  
  408.     ENTER FILENAME OF SOURCE FILE :  ACCTREC.FRM
  409.  
  410.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  411.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  412.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  413.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  414.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  415.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  416.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  417.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  418.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  419.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  420.  
  421.     ENTER CURRENT DATE (MM/DD/YY)  :  05/20/85
  422.  
  423.     ACCTREC.DAT HAS BEEN CREATED FOR USE WITH FILER PROGRAMS.
  424.  
  425.  
  426.   NOW, THE CREATION OF A FILER DATABASE FILE HAS BEEN COMPLETED.
  427. LOAD  IN  THE FILER DATABASE PROGRAM AND ENTER ACCTREC WHEN  THE
  428. PROGRAM ASKS FOR THE SOURCE FILE.
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                 7
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.                           FILER PROGRAM
  468.                           =============
  469.  
  470.    THE FILER PROGRAM permits the user to display,  add,  correct,
  471. or  delete  data records from the disk file.  Upon entry  to  the
  472. program,  the  user will be asked to input the name of the  FILER
  473. FILE  to be opened and the current date.  FILER FILE  names  must
  474. conform  to  the  rules  for file  names  required  by  the  Disk
  475. Operating  System  and have a file extension of either ".DAT"  or
  476. ".BAK".   FILER FILES with the ".BAK" file extension are the back
  477. up of the most current version.
  478.  
  479.    DATA  DISPLAY  MODES  :  The FILER PROGRAM uses two  modes  or
  480. levels when data records are being displayed (1) DATA RECORD MODE
  481. and (2) FIELD DATA MODE.  In the DATA RECORD MODE,  only complete
  482. data  records  are displayed with special keys referring  to  the
  483. data record as a whole.  For example, if RETURN key is depressed,
  484. the next whole data record to be displayed on the screen.  On the
  485. other  hand,  while  in  the FIELD DATA MODE,  special  keys  are
  486. defined  to act on the individual data fields which make  up  the
  487. whole  data record.  For example,  while in the FIELD DATA  MODE,
  488. depressing  the CTRL X key will cause the next field in the  data
  489. record  to be available for editing or data entry.  Note that the
  490. item  referenced  is the field as opposed to  the  whole  record.
  491. Using  two  display modes makes it possible to step thru  a  data
  492. file,  examining whole records at a time with a minimum number of
  493. keystrokes  to  advance from one record to the next.  When it  is
  494. desired to change from DATA RECORD MODE to FIELD DATA MODE,  this
  495. may be accomplished by depressing the F2 FUNCTION key.  To change
  496. back  from FIELD DATA MODE to DATA RECORD MODE,  depress  the  F1
  497. FUNCTION key.
  498.  
  499.    FILER MENU :  The FILER MENU is utilized to select the various
  500. functions  that  will  be performed by the program  on  the  data
  501. contained within a FILER FILE :
  502.  
  503.                (1) ADD / ENTER RECORDS
  504.  
  505.                (2) DISPLAY RECORDS
  506.  
  507.                (3) CORRECT RECORD
  508.  
  509.                (4) DELETE RECORD
  510.  
  511.                (5) END FILER PROGRAM
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                 8
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533. ADD / ENTER RECORDS
  534. ===================
  535.  
  536.    Selection  of the ADD / ENTER RECORD option on the  menu  will
  537. begin  a loop to continuously enter new records.  The screen will
  538. clear  and a null or empty data record will be displayed  on  the
  539. screen.  Data  field  names will be displayed with blank  (filled
  540. with spaces) fields after each field label.  The program will  be
  541. in FIELD DATA MODE in which data can be successively entered into
  542. each data field.  After entries have been made,  the program will
  543. prompt, DATA OK (Y/N) ?  A response of "N" will cause the program
  544. to  return to the first field and permit correction of data.  Any
  545. response  other  than "N" will cause the program to build  a  new
  546. data  record  ,  append this new data record to the  end  of  the
  547. existing  data records in the FILER FILE and update the number of
  548. records.  If the F1 FUNCTION key is depressed,  the program  will
  549. return  to the FILER MENU.  A "Y" key will cause the record to be
  550. saved and the screen cleared for the entry of another record. The
  551. only  means of ending the continuous input of new records  is  to
  552. use the F1 FUNCTION key.
  553.  
  554.  
  555. DISPLAY RECORDS
  556. ===============
  557.  
  558.    Selection of the DISPLAY RECORDS option will cause the program
  559. to request the number of the first record to be  displayed.  Then
  560. in DATA RECORD MODE,  the program will successively display whole
  561. records. When a given data record is displayed on the screen, the
  562. 24th  line  will contain the prompt "RETURN TO CONTINUE" and  the
  563. record number.
  564.  
  565.    There are several special keys that will facilitate use of the
  566. FILER PROGRAM :
  567.  
  568. RETURN  KEY,        Causes  the next DATA RECORD to be  displayed
  569. CTRL F, CTRL G,     or  if the current record is the last one  in
  570. F10 FUNCTION KEY the file causes the MENU to be displayed.
  571.  
  572. F9 FUNCTION,        If  the  current record is  not  already  the
  573. CTRL D, CTRL A      first record in the file,  the DOWN ARROW KEY
  574.                     will  Cause  the previous DATA RECORD  to  be
  575.                     displayed.
  576.  
  577. F2 FUNCTION KEY,    Causes the program to change from DATA RECORD
  578. CTRL E, CTRL X      MODE  to  FIELD DATA MODE thereby  making  it
  579.                     possible  to edit or modify the data in  each
  580.                     DATA FIELD.
  581.  
  582. F1 FUNCTION KEY     Causes  the program to leave the DATA  RECORD
  583.                     MODE  and return to the program MENU.
  584.  
  585. BACK ARROW KEY      Causes a OK TO DELETE (Y/N) ?   prompt and on
  586.                     a  "Y" answer causes the current record to be
  587.                     replaced with a NULL or EMPTY data record
  588.  
  589.  
  590.                                 9
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.    When in the DISPLAY RECORDS mode, the entry of the F2 FUNCTION
  600. KEY  or the CTRL X or CTRL E will cause the program to enter  the
  601. FIELD DATA MODE. In this mode, the cursor will move from field to
  602. field in the record to identify which field is available for data
  603. entry or modification.
  604.  
  605.    In  the  FIELD  DATA EDIT MODE,  WORDSTAR  like  commands  are
  606. available  to  edit data in the active  field.  The  special  key
  607. functions are :  CTRL A,  CTRL S, CTRL D, CTRL F, CTRL T, CTRL Q,
  608. CTRL  W,  FUNCTION  KEY 6,  FUNCTION KEY 8,  FUNCTION KEY  9  and
  609. FUNCTION  KEY 10.  These keys control the data in the edit  field
  610. and  the position of the cursor.  In general,  new characters and
  611. entered  under  the cursor position with the  cursor  moving  one
  612. position to the right. When characters are deleted, the character
  613. PRIOR to the cursor position is deleted.
  614.  
  615.  
  616. RETURN KEY          Causes the cursor to move to the next  field.
  617.                     If  the field just edited is the last  field,
  618.                     the  record will be saved for writing to disk
  619.                     and  the  program  will return  to  the  DATA
  620.                     RECORD MODE.
  621.  
  622. CTRL S              Causes  the cursor to move one  character  to
  623.                     the left in the edit field.
  624.  
  625. CTRL D              Causes  the  cursor to move one character  to
  626.                     the right in the edit field.
  627.  
  628. CTRL A              Causes  the  cursor to move one word  to  the
  629.                     left in the edit field.
  630.  
  631. CTRL F              Causes  the  cursor to move one word  to  the
  632.                     right in the edit field.
  633.  
  634. CTRL G              Causes  the character under the cursor to  be
  635.                     deleted.  (The  BACK  ARROW  key  causes  the
  636.                     character before the cursor to be deleted.)
  637.  
  638. CTRL T              Causes the word to the right of the cursor to
  639.                     be deleted and all characters to the right to
  640.                     be  moved  to  the  left  to  close  the  gap
  641.                     created.
  642.  
  643. CTRL Y              Causes  the entire field to be replaced  with
  644.                     spaces.
  645.  
  646. CTRL Q              Causes  the cursor to move to the left margin
  647.                     of the current field.
  648.  
  649. CTRL W              Causes the cursor to move to the right margin
  650.                     of the current field.
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                10
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665. BACK ARROW KEY      Causes  the character preceding the cursor to
  666.                     be  deleted and subsequent characters to  the
  667.                     right  to  all be moved one position  to  the
  668.                     left.
  669.  
  670.  
  671. TAB KEY             Causes  the  cursor to move 6 spaces  to  the
  672.                     right in the data field. Existing data in the
  673.                     field is not changed by use of the TAB KEY.
  674.  
  675.    In  addition  to the special keys used to edit or enter  data,
  676. there are several keys to permit manipulation of data or movement
  677. between fields.  These keys are FUNCTION 1,  FUNCTION 6, FUNCTION
  678. 8,  FUNCTION 9,  FUNCTION 10,  BACKSLASH, CTRL E, CTRL X, CTRL C,
  679. and CTRL R.
  680.  
  681. FUNCTION 6,         Causes  the   cursor  to move  to  the  field
  682. CTRL E              preceding the current data field.
  683.  
  684. FUNCTION 8,         Causes  the cursor to move to the next  field
  685. CTRL X              in the file.
  686.  
  687. CTRL R              Causes  the cursor to move to the first field
  688.                     in the record.
  689.  
  690. BACK SLASH KEY      This key when depressed causes the program to
  691.                     display the message : "FIND LABEL ..... ENTER
  692.                     TARGET :  ". Date entered in response to this
  693.                     message  is  compared  with the  data  labels
  694.                     which identify each data field. If a match is
  695.                     found with any of the data field labels,  the
  696.                     cursor will move to that field.  If no  match
  697.                     can  be  found,  the first field of the  data
  698.                     record  will  be displayed.  For  example  if
  699.                     after the entry of the "\", the data "NAM" is
  700.                     entered,  the program will examine all  field
  701.                     names  starting  with the first field for  an
  702.                     field name that begins with the three letters
  703.                     "NAM".  If for example,  one field was  named
  704.                     "NAME" a match would be found and the  cursor
  705.                     will move to that field.
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                                11
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731. F10 FUNCTION KEY    This  key  when  depressed  causes  FILER  to
  732.                     display  the message :  "SEARCH UP...   ENTER
  733.                     TARGET  :".  Data  entered in  response  will
  734.                     cause  the program to search all higher  data
  735.                     records  for a match on the characters  which
  736.                     are identified as the TARGET.  For example if
  737.                     the  user  is  in  DATA FIELD  #  N  and  the
  738.                     characters  "HARLAN" are entered in  response
  739.                     to  the TARGET :   prompt,  the program  will
  740.                     examine  each data record with higher  record
  741.                     numbers  for  data  in  DATA FIELD  #  N  for
  742.                     characters  which  match  with  the   letters
  743.                     "HARLAN".  THIS  COMPARISON  FUNCTION IS  NOT
  744.                     POSITION SENSITIVE.  If the target is matched
  745.                     anywhere  in the field,  that record will  be
  746.                     displayed  so the user may edit or enter  new
  747.                     or  revised  data.   This  feature  makes  it
  748.                     possible for a user to search a file for  any
  749.                     given  name or value without having to  read,
  750.                     display,  and  examine  the contents of  each
  751.                     DATA RECORD.
  752.  
  753.                     If  the  search is being made for data  in  a
  754.                     numeric field,  the number value entered will
  755.                     be  converted to REAL NUMERIC FORMAT and  the
  756.                     search  will  be for an exact  match  of  the
  757.                     numeric value. If the search is being made in
  758.                     an ASCII field,  then the search will be made
  759.                     by  comparing  the data input as  the  search
  760.                     target  with  all the data in the  comparison
  761.                     fields. Note that in this ASCII comparison, a
  762.                     match  is not dependent upon the position  of
  763.                     the data.
  764.  
  765.                     When   searching  a  numeric  field,   it  is
  766.                     possible  to look for values greater than  or
  767.                     less  than the TARGET VALUE by including  the
  768.                     greater  than sign ">" or the less than  sign
  769.                     "<" as the first character of the field.  For
  770.                     example,  if  it was desired to  find  values
  771.                     greater than, say,  12.45, enter >12.45 after
  772.                     the  ENTER TARGET request.  To find a  number
  773.                     smaller than,  say,  99.9,  enter <99.9 after
  774.                     the ENTER TARGET request.
  775.  
  776.                     FILER  saves the target value that is entered
  777.                     in  a search and makes it possible to  repeat
  778.                     the search for the same target.  To start the
  779.                     search again, first depress the F10 KEY. Then
  780.                     to  search for the same target,  depress  the
  781.                     F10  KEY a second time without entering other
  782.                     data.  FILER  will display the  target  value
  783.                     saved and commence the search.
  784.  
  785.  
  786.  
  787.  
  788.                                12
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797. F9 FUNCTION KEY     This  key causes the FILER program to  search
  798.                     all  LOWER  data records for a match  on  the
  799.                     data  which  was entered in response  to  the
  800.                     message  "SEARCH DOWN....  ENTER  TARGET  :".
  801.                     Operation   is  otherwise  the  same  as  the
  802.                     GREATER THAN KEY above.
  803.  
  804.  
  805. F1 FUNCTION KEY     This  key will cause the program to skip  the
  806. CTRL C              remaining fields in the data record and go to
  807.                     the DATA OK prompt which occurs at the end of
  808.                     data input to the fields of a DATA RECORD. In
  809.                     essence it permits the user to exit the FIELD
  810.                     DATA MODE and return to the DATA RECORD MODE.
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                13
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863. CORRECT RECORD
  864. ==============
  865.  
  866.    Selection  of  the CORRECT RECORD option permits the  user  to
  867. make  changes to the data held in any given  DATA  RECORD.  After
  868. this option has been selected, the FILER program will request the
  869. record  number of the DATA RECORD which is to be modified.  After
  870. receiving  a  valid number,  the program will  display  the  DATA
  871. RECORD in FIELD DATA MODE with the first field available for edit
  872. or data entry.
  873.  
  874.    All  special key functions detailed under the DISPLAY RECORDS,
  875. FIELD  DATA  MODE are operative at this  time.  Data  fields  are
  876. processed  sequentially and at the end the prompt DATA RECORD OK?
  877. (Y/N)  is shown.  A "N" response will cause the first field to be
  878. displayed again for edit or data entry.  Any other response  will
  879. cause the program to store the DATA RECORD as modified and return
  880. to the MENU.
  881.  
  882.  
  883. DELETE RECORD
  884. =============
  885.  
  886.    This option permits the user to replace the data stored in any
  887. given  DATA  RECORD with a NULL or EMPTY data record.  After  the
  888. option is selected,  the program will ask for a record number  to
  889. be  entered.  After a valid number is entered,  the program  will
  890. display  the contents of that DATA RECORD and display the  prompt
  891. OK TO DELETE?  A "Y" response will cause the record to be deleted
  892. by  being replaced with a NULL or EMPTY data record.  The  record
  893. still exists, but there is nothing stored in it. NULL records can
  894. be  eliminated  from  a FILER FILE by sorting the file  with  the
  895. SORTER program.
  896.  
  897.  
  898.  
  899. END FILER PROGRAM
  900. =================
  901.  
  902.    At the conclusion of using the FILER PROGRAM, it is IMPERATIVE
  903. that  the return to the DISK OPERATING SYSTEM be made via  OPTION
  904. NUMBER 5.   In this option, the program performs the housekeeping
  905. function of closing open files to ensure that data stored in  the
  906. file  will be available in the future.  If the program "blows up"
  907. and exits to the DISK OPERATING SYSTEM without closing the  FILER
  908. FILE,  it is possible that recently added data in the file may be
  909. lost.  It is highly recommended that regular backup procedures be
  910. followed so that recovery is as painless as possible!
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.                                14
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.                              SORTER
  930.                              ======
  931.  
  932.   The SORTER program permits the user to sort any FILER FILE. The
  933. program utilizes the following steps:
  934.  
  935.   First,  the  order of sort is determined by designating one  or
  936. more fields within the record as the KEY fields. A maximum of ten
  937. fields may be used to define the KEY.
  938.   Second,  each  record  of the file is read and  data  from  the
  939. fields  designated  as  KEY  fields is  assembled  in  the  order
  940. selected into a file held in computer memory.
  941.   Third, the KEY field file is sorted to determine  the  desired
  942. order of each record in the file.
  943.   Fourth,  Using  this order,  records are read from the old file
  944. and written to the replacement file in the desired sorted order.
  945.  
  946.  
  947.                     EXAMPLE OF SORTING A FILE
  948.                     =========================
  949.  
  950.   To  sort  a file,  such as the ACCTREC.DAT,  get to  the  Disk
  951. Operating  System prompt for your computer and enter the  program
  952. name "SORTER".  The program will load,  the screen will clear and
  953. display  the  message "SORT A LA PASCAL" followed by  the  prompt
  954. "ENTER SOURCE FILE NAME :  ".   Enter "ACCTREC", the name of the
  955. FILER FILE that is to be sorted.  If the file name entered exists
  956. as a disk file, the program will perform the following steps:
  957.  
  958.   1. If  a  file of the same name with the file extension  ".BAK"
  959.      exists, it will be deleted and the message "ACCTREC.BAK HAS
  960.      BEEN DELETED." will be displayed.
  961.  
  962.   2. The  file  that  is  to  be  sorted  will  be  renamed  from
  963.      "ACCTREC.DAT"   TO   "ACCTREC.BAK".   Next   the   message
  964.      "ACCTREC.DAT RENAMED ACCTREC.BAK" will be displayed on the
  965.      screen.
  966.  
  967. The source FILER FILE will not be modified in any way by the sort
  968. procedure.  If for any reason, the sort process does not complete
  969. successfully and create a replacement FILER FILE,  it is possible
  970. to  recover the original file by using the rename  capability  of
  971. the Disk Operating System:
  972.  
  973.   REN ACCTREC.DAT = ACCTREC.BAK    (FOR CP/M COMPUTER DOS)
  974.   RENAME ACCTREC.BAK ACCTREC.DAT     (FOR PC DOS COMPUTERS )
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                15
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995. The  screen will clear and the labels for each field followed  by
  996. an equals and a field number will be displayed.  For the ACCTREC
  997. FILER FILE, the screen looks like this:
  998.  
  999.  
  1000. NAME  = 1                          ACCOUNT REC = 9
  1001. ADDR1 = 2                          AMT PAST DUE = 10
  1002. ADDR2 = 3
  1003. CITY  = 4                          AREA CODE = 7
  1004. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1005.  
  1006. IN ORDER OF IMPORTANCE :
  1007.  
  1008. ENTER KEY FIELD NUMBER :
  1009.  
  1010.  
  1011.  
  1012. If,  for  example,  it was desired to sort the FILER FILE by AREA
  1013. CODE  as the first criteria and then to sort the records by  NAME
  1014. as the second criteria,  first enter the digit "7" which is found
  1015. as the field number corresponding to the label AREA CODE.
  1016.  
  1017.  
  1018.  
  1019. NAME  = 1                          ACCOUNT REC = 9
  1020. ADDR1 = 2                          AMT PAST DUE = 10
  1021. ADDR2 = 3
  1022. CITY  = 4                          AREA CODE = 7
  1023. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1024.  
  1025. IN ORDER OF IMPORTANCE :
  1026.  
  1027. ENTER KEY FIELD NUMBER : 7
  1028.  
  1029.  
  1030. The  screen will change on the 23rd and 24th lines of the  screen
  1031. to prompt for the entry of the NEXT KEY FIELD:
  1032.  
  1033.  
  1034. NAME  = 1                          ACCOUNT REC = 9
  1035. ADDR1 = 2                          AMT PAST DUE = 10
  1036. ADDR2 = 3
  1037. CITY  = 4                          AREA CODE = 7
  1038. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1039.  
  1040. IN ORDER OF IMPORTANCE :
  1041.  
  1042. ENTER NEXT KEY FIELD :
  1043. ENTER RETURN ONLY TO END KEY DEFINITION
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.                                16
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061. Next enter the digit "1" as the field number which corresponds to
  1062. the label NAME :
  1063.  
  1064.  
  1065. NAME  = 1                          ACCOUNT REC = 9
  1066. ADDR1 = 2                          AMT PAST DUE = 10
  1067. ADDR2 = 3
  1068. CITY  = 4                          AREA CODE = 7
  1069. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1070.  
  1071. IN ORDER OF IMPORTANCE :
  1072.  
  1073. ENTER NEXT KEY FIELD : 1
  1074. ENTER RETURN ONLY TO END KEY DEFINITION
  1075.  
  1076.  
  1077. To  end  the  KEY DEFINITION,  depress  the  return  key  without
  1078. entering a digit (null entry).  The program will clear the screen
  1079. and display :
  1080.  
  1081.  
  1082. KEY FIELDS SELECTED ARE :
  1083. =========================
  1084.  
  1085. 1 : AREA CODE
  1086. 2 : NAME
  1087.  
  1088. =========================
  1089.  
  1090. KEYLENGTH = 25
  1091. IS THIS OK (Y/N) :
  1092.  
  1093. If  the KEY FIELDS selected are correct and in the desired order,
  1094. enter "Y" or else enter "N".   If "N" is entered,  the process of
  1095. selecting KEY FIELDS will begin again.  If "Y" is selected,  then
  1096. the  actual sort process will begin.  As records are read and the
  1097. key  fields assembled,  the KEY FIELD data and the RECORD  NUMBER
  1098. will  be displayed on the screen.  For the "ACCTREC"  FILE,  the
  1099. display might look like this:
  1100.  
  1101. 313John Doe             1
  1102. 317Sam Spade            2
  1103. 419K. Philip            3
  1104. 215Ben Dogood           4
  1105.  
  1106. ===___________________===
  1107.  \       \              \
  1108.   \       \              \__ Record Number
  1109.    \       \__ NAME
  1110.     \
  1111.      \__ AREA CODE
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.                                17
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127. Following the reading of the records of the file and the creation
  1128. of  the  KEY  FIELDS,  the screen will clear  and  the  following
  1129. messages will be displayed:
  1130.  
  1131.  
  1132. DATA INPUT COMPLETED
  1133.  
  1134.  ..oO[  SORTING  ]Oo..
  1135.  
  1136.  ..oO[  KEY SORT DONE  ]Oo..
  1137.  
  1138.  ..oO[  MOVING RECORDS  ]Oo.
  1139.  
  1140.  ..oO[  RECORDS MOVED  ]Oo..
  1141.  
  1142.  0   [  0 INDICATES SUCCESSFUL SORT  ]
  1143.  
  1144.  ..oO[   HAVE A GREAT DAY!   ]Oo..
  1145.  
  1146.  
  1147. The source FILER FILE will not be modified in any way by the sort
  1148. procedure.  If for any reason, the sort process does not complete
  1149. successfully and create a replacement FILER FILE,  it is possible
  1150. to  recover the original file by using the rename  capability  of
  1151. the Disk Operating System:
  1152.  
  1153.   REN ACCTREC.DAT = ACCTREC.BAK    (FOR CP/M COMPUTER DOS)
  1154.   RENAME ACCTREC.BAK ACCTREC.DAT     (FOR PC DOS COMPUTERS )
  1155.  
  1156. Disk sorts fail most often due to lack of available storage space
  1157. on the disk.  If this is the case, correct the situation before a
  1158. second attempt is made to sort the disk. FOR SAFETY, IF YOUR SORT
  1159. FAILS,  EXIT THE SORT PROGRAM AND IMMEDIATELY COPY ALL FILES WITH
  1160. THE  NAME  OF YOUR FILER FILE AND ANY FILE EXTENSION  TO  ANOTHER
  1161. DISK.  In this way,  you will protect yourself from  accidentally
  1162. "BACKING UP YOUR FILES OUT OF EXISTENCE".
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.                                18
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.                          STARTER PROGRAM
  1194.                          ===============
  1195.  
  1196.   The  STARTER  program  is a beginning framework  for  a  report
  1197. program that assists the user in preparing custom output reports.
  1198. The  program  has been divided into two parts  "STARTER.PAS"  and
  1199. "STARTER1.PAS".  In general, STARTER.PAS, contains the procedures
  1200. necessary  to access a FILER FILE,  read data within each record,
  1201. and edit the data into a from suitable for display.  STARTER1.PAS
  1202. contains  the code to open a specific FILER FILE and  write  data
  1203. into a custom report.
  1204.  
  1205.   To  utilize the STARTER program,  it is necessary to be able to
  1206. modify  the  program  which  is  written  in  TURBO  PASCAL.  The
  1207. procedure  to  modify a source program and  create  a  executable
  1208. program is as follows:
  1209.   (1)  Select the disk which contains the TURBO PASCAL  programs,
  1210.   STARTER.PAS  AND STARTER1.PAS.  Bring your computer up  and  if
  1211.   necessary go to the drive which will activate this disk.
  1212.   (2)  Make copies of the files "STARTER.PAS" and  "STARTER1.PAS"
  1213.   giving the copies a name appropriate to the application  report
  1214.   that you are creating.  For this discussion, it is assumed that
  1215.   the  application is an ACCOUNTS RECEIVABLE report and the  file
  1216.   will be renamed "ACCTREC.PAS" AND "ACCTREC1.PAS".
  1217.   (3) Enter "TURBO"  and depress the return key.
  1218.   (4)  Respond "Y" when turbo asks if you wish to  include  error
  1219.   messages.
  1220.   (5)  Depress  "M"  for main file and enter  "ACCTREC"  and  the
  1221.   return   key.   This  instructs  TURBO  PASCAL  to  begin   any
  1222.   compilation using the file "ACCTREC.PAS".
  1223.   (6)  Depress  "E"  for edit and the source  code  contained  in
  1224.   "ACCTREC.PAS" will be displayed on the screen.  In general, the
  1225.   code in this source file does not have to be modified to create
  1226.   a  custom report file with one important exception.  The source
  1227.   code  is  divided into two parts and the first part  chains  or
  1228.   links  to  the second part with a  compiler  directive.  It  is
  1229.   necessary  to  modify this compiler directive which is  in  the
  1230.   last   line   of   code  in  this   file.   Change   the   code
  1231.   "{$ISTARTER1.PAS}" TO "{$IACCTREC1.PAS}". This instruction causes
  1232.   the  compiler  to load the file "ACCTREC1" and to continue  the
  1233.   compilation with this code.  See "COMPILER DIRECTIVES"  in  the
  1234.   TURBO PASCAL manual for further information.
  1235.   (7) Key in "CTRL K" AND "D" to exit the TURBO PASCAL editor.
  1236.   (8) Depress "S" to cause TURBO PASCAL to save the changed file.
  1237.   (9)  Depress  "W" for work file and enter  "ACCTREC1"  and  the
  1238.   depress the return key.  This establishes "ACCTREC1.PAS" as the
  1239.   file  that  you which to work with to modify  the  program.
  1240.   (10)  Depress "E" and the TURBO PASCAL editor will display  the
  1241.   contents  of  "ACCTREC1.PAS".  Make  the modifications  to  the
  1242.   source  code  to customize the report program  to  the  desired
  1243.   form.
  1244.   (11)  Key in "CTRL K" AND "D" to exit the editor and return  to
  1245.   TURBO PASCAL.
  1246.   (12) Key in "S" to save the file by writing it to disk.
  1247.   (13) Key in "O" for "Options"
  1248.  
  1249.  
  1250.                                19
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.   (14) Key in "C" to build a "COM" FILE.
  1260.   (15) KEY IN "Q" to quit the options loop.
  1261.   (16)  Key in "C" to compile the program and build an executable
  1262.   com file on disk under the file name "ACCTREC.COM".
  1263.   (17) Key in "Q" to quit TURBO PASCAL and return to DOS.
  1264.   (18) Key in "ACCTREC" and depress return to run the  customized
  1265.   report program. (Make sure the printer is on and selected).
  1266.  
  1267.  
  1268.  
  1269. CONTENTS OF STARTER.PAS
  1270. =====================
  1271.  
  1272.   "STARTER" contains the following functions / procedures:
  1273.  
  1274. BCDTOIN:                CONVERT   BINARY  CODED  DECIMAL  TO   AN
  1275.                         INTEGER VALUE.
  1276.  
  1277. CHTOIN:                 CONVERT A PORTION OF AN ASCII STRING INTO
  1278.                         AN INTEGER VALUE.
  1279.  
  1280. GETDATAFROMARRAY:       EXTRACT DATA FROM AN ARRAY OF  CHARACTERS
  1281.                       AND CONVERT INTO A STRING EXPRESSION.
  1282.  
  1283. TIDE:                   DELETE  COMMAS,  DOLLAR  SIGNS  AND  PLUS
  1284.                         SIGNS  FROM THE ASCII STRING DISPLAY OF A
  1285.                        NUMBER.
  1286.  
  1287. EDITNBR:                EDIT  A NUMBER TO DISPLAY  DOLLAR  SIGNS,
  1288.                         COMMAS, AND MINUS SIGN TO IMPROVE CLARITY
  1289.                         IN READING THE VALUE.
  1290.  
  1291. STRINGTOREAL:           CONVERT  A ASCII STRING REPRESENTATION OF
  1292.                         A NUMBER INTO A REAL DATA FORM TO  PERMIT
  1293.                         USE  TO  THE  VALUE WITHIN  THE  COMPUTER
  1294.                         PROGRAM.
  1295.  
  1296. CALCULATE:              CALCULATE    DATA   RECORD   NUMBER   AND
  1297.                         PRECEDING  BYTE FOR USE  WITH  GETDATAREC
  1298.                         PROCEDURE.
  1299.  
  1300. GETDATAREC:             PROCEDURE  TO READ AND WRITE DATA  RECORD
  1301.                         FROM  DISK  AND PLACE IT IN  A  CHARACTER
  1302.                         ARRAY NAMED "GETDATA".
  1303.  
  1304. EXIST:                  FUNCTION  TO  DETERMINE  IF  A   FILENAME
  1305.                         EXISTS IN THE DISK DIRECTORY.
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.                                20
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325. MOVERECORDDATATOARRAY:  PROCEDURE  TO  READ  A FILER  RECORD  AND
  1326.                         PLACE  THE FIELD DATA INTO AN  ARRAY.  IF
  1327.                         THE DATA IS ASCII AND IN THE NTH FIELD OF
  1328.                         THE RECORD, THIS PROCEDURE WILL PLACE THE
  1329.                         ASCII DATA IN ASCIIFIELD[N].  IF THE DATA
  1330.                         IS  NUMERIC AND IN THE  NTH  FIELD,  THIS
  1331.                         PROCEDURE WILL PLACE THE NUMERIC VALUE IN
  1332.                         NUMFIELD[N].  THE VARIABLES ASCIIFIELD[N]
  1333.                         AND  NUMFIELD[N]  MAY BE USED  IN  PASCAL
  1334.                         STATEMENTS  TO DISPLAY OR MANIPULATE DATA
  1335.                         IN ANY DESIRED FASHION.
  1336.  
  1337. STARTER.PAS   ENDS  WITH  THE  STATEMENT  {$ISTARTER1.PAS}  WHICH
  1338. INSTRUCTS  THE COMPILER TO INCLUDE THE SOURCE CODE  CONTAINED  IN
  1339. THE  PROGRAM "STARTER1.PAS".  WHEN THE STARTER PROGRAM IS USED AS
  1340. THE BASIS FOR A CUSTOM REPORT,  IT MUST BE COPIED AND RENAMED  TO
  1341. REFLECT THE NATURE OF THE REPORT.  FOR EXAMPLE,  IF THE REPORT IS
  1342. AN  ACCOUNTS RECEIVABLE REPORT,  THEN STARTER.PAS MIGHT BE COPIED
  1343. AND  RENAMED  ACCTREC.PAS  AND  STARTER1.PAS  MIGHT  BE   RENAMED
  1344. ACCTREC1.PAS.  AT  THIS  TIME IT IS NECESSARY TO RENAME THE  LAST
  1345. STATEMENT    IN    ACCTREC.PAS     FROM    {$ISTARTER1.PAS}    TO
  1346. {$IACCTREC1.PAS}  SO THAT THE COMPILER INCLUDES THE  PROPER  CODE
  1347. WHEN ACCTREC.PAS IS COMPILED.
  1348.  
  1349.  
  1350. CONTENTS OF STARTER1.PAS
  1351. =======================
  1352.  
  1353. "STARTER1" CONTAINS THE FOLLOWING PROCEDURES:
  1354.  
  1355. INITIALIZE:         PROVIDES CODE TO IDENTIFY THE REPORT NAME AND
  1356.                     INPUT  THE FILER FILE NAME AND CURRENT  DATE.
  1357.                     READS HEADER INFORMATION FROM FILER FILE  AND
  1358.                     INITIALIZES  VARIABLES  FOR  ENTRY  INTO  THE
  1359.                     REPORT PROGRAM.
  1360.  
  1361. NEWPAGE:            CAUSES PRINTER TO EXECUTE A FORMFEED.
  1362.  
  1363. PAGETITLE:          PRINTS  THE TITLE OF THE REPORT AND THE  PAGE
  1364.                     NUMBER.
  1365.  
  1366. DATAHEADINGS:       PRINTS  A DATA HEADING TO IDENTIFY THE USE OF
  1367.                     EACH COLUMN OF DATA.
  1368.  
  1369. PRINTSUBTOTALS:     PRINTS SUB TOTALS FOR THE COLUMNS OF DATA AND
  1370.                     THEN SETS THE SUB TOTAL TO ZERO.
  1371.  
  1372. PRINTGRANDTOTALS    PRINTS THE GRAND TOTALS FOR THE DATA THAT HAS
  1373.                     BEEN PRINTED.
  1374.  
  1375. These  procedures  are then followed by the code for  the  actual
  1376. program that uses all the functions and procedures listed above.
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.                                21
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391. CREATING A CUSTOMIZED REPORT PROGRAM
  1392. ====================================
  1393.  
  1394.   The  FILER  FILE  "ACCTREC" will be used as an example  of  the
  1395. process  of creating a customized report program.  "ACCTREC"  was
  1396. selected  as the name for the report program.  The first step  is
  1397. then  to copy the STARTER.PAS AND STARTER1.PAS programs to  files
  1398. called  "ACCTREC.PAS  "   and  "ACCTREC1.PAS".  This  leaves  the
  1399. STARTER  PROGRAMS available for use with another report  program.
  1400. Since  all  modifications  will  be  made  to  ACCTREC.PAS    and
  1401. ACCTREC1.PAS,  the program generated will automatically be  named
  1402. "ACCTREC.COM".
  1403.  
  1404.   The  "STARTER" programs refer to data in the filer file by  the
  1405. array  names  ASCIIFIELD[N] and NUMFIELD[N].  The easiest way  of
  1406. getting a list of the fields in the FILER FILE is to print a copy
  1407. of the file generated by the "PICTOFRM" PROGRAM. In this example,
  1408. the contents of "ACCTREC.FRM" look like this:
  1409.  
  1410.  
  1411.     NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  1412.     ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  1413.     ADDR2 : AAAAAAAAAAAAAAAAAAAA
  1414.     CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  1415.     STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  1416.  
  1417.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  1418.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  1419.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  1420.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  1421.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  1422.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  1423.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  1424.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  1425.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  1426.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  1427.  
  1428. Extract the information on FORM and LABEL as follows:
  1429.  
  1430.  
  1431.     FORM 15, LABEL >NAME  <             FIELD 1   ASCIIFIELD[1]
  1432.     FORM  2, LABEL >ACCOUNT REC  <      FIELD 2   NUMFIELD[2]
  1433.     FORM 15, LABEL >ADDR1 <             FIELD 3   ASCIIFIELD[3]
  1434.     FORM  2, LABEL >AMT PAST DUE <      FIELD 4   NUMFIELD[4]
  1435.     FORM 15, LABEL >ADDR2 <             FIELD 5   ASCIIFIELD[5]
  1436.     FORM 15, LABEL >CITY <              FIELD 6   ASCIIFIELD[6]
  1437.     FORM 15, LABEL >AREA CODE <         FIELD 7   ASCIIFIELD[7]
  1438.     FORM 15, LABEL >STATE <             FIELD 8   ASCIIFIELD[8]
  1439.     FORM 15, LABEL >ZIPCODE <           FIELD 9   ASCIIFIELD[9]
  1440.     FORM 15, LABEL >PHONE NBR <         FIELD 10  ASCIIFIELD[10]
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.                                22
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457. Field  numbers  start with 1 and are numbered in the  same  order
  1458. that the cursor moves from field to field.  Any field with a FORM
  1459. 15  is an ascii field.  Any field with a digit other than 15 is a
  1460. numeric field with the decimal value determining how many  digits
  1461. are displayed to the right of the decimal point.
  1462.  
  1463. IN  WRITING  A  CUSTOMIZED  REPORT,  DATA IN EACH  FIELD  CAN  BE
  1464. REFERENCED  USING  THE VARIABLE ARRAY  NAMES  "ASCIIFIELD[N]  FOR
  1465. ALPHA  DATA  AND NUMFIELD[N] FOR NUMERIC DATA WHERE N STANDS  FOR
  1466. THE  FIELD NUMBER. For example,  to print the alpha data in field
  1467. 1,  use the code : "WRITELN(LST,ASCIIFIELD[1];". Or, to print the
  1468. number in field 4, use the code : "WRITELN(LST,NUMFIELD[4];".
  1469.  
  1470.   To  customize the title of the report,  search source code  for
  1471. the following PASCAL CODE:
  1472. {================================================================}
  1473. {                 PROCEDURE PAGE TITLE                           }
  1474. {================================================================}
  1475. PROCEDURE PAGETITLE;
  1476. BEGIN
  1477.   WRITE(LST,'                   SAMPLE REPORT TITLE               ');
  1478.   WRITELN(LST,'PAGE ',PAGE);
  1479.   WRITELN(LST);
  1480.   WRITELN(LST);
  1481.   PAGE := PAGE +1;
  1482.   LINE := LINE +3;
  1483. END;
  1484. Revise  the  line that include the text "SAMPLE REPORT TITLE"  to
  1485. the desired report title.  Add spaces after the title so that the
  1486. location of the page number is correct in the final document.
  1487.  
  1488.  
  1489.   To customize the DATA HEADINGS,  search the source code for the
  1490. following PASCAL CODE :
  1491. {================================================================}
  1492. {                 PROCEDURE DATA HEADING                         }
  1493. {================================================================}
  1494. PROCEDURE DATAHEADING;
  1495. BEGIN
  1496.   WRITELN(LST,'      NAME          ADDRESS       ACCOUNT 1       ACCOUNT 2');
  1497.   WRITELN(LST,'===========================================================');
  1498.   WRITELN(LST);
  1499.   LINE := LINE +3;
  1500. END;
  1501. Modify the lines which list the column names and the underline to
  1502. conform to the desired report format and data content.
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.                                23
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.   To  customize  the  SUB TOTALS,  find the source code  for  the
  1524. following PASCAL CODE :
  1525. {================================================================}
  1526. {                 PROCEDURE PRINT SUB TOTALS                     }
  1527. {================================================================}
  1528. PROCEDURE PRINTSUBTOTALS;
  1529. BEGIN
  1530.   WRITELN(LST,'                                  ============   ==========');
  1531.   WRITE(LST,'SUB TOTAL :                         ');
  1532.   ANS := EDITNBR(SUBTOTAL[5],10,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1533.   WRITE (LST,ANS);
  1534.   ANS := EDITNBR(SUBTOTAL[6],13,1,' ');   { SUB TOTAL FOR ACCOUNT 2 }
  1535.   WRITELN(LST,ANS);
  1536.   WRITELN(LST);
  1537.  
  1538.   SUBTOTAL[5] := 0;
  1539.   SUBTOTAL[6] := 0;
  1540.  
  1541.   LINE := LINE + 3;
  1542.  
  1543.   IF LINE > PAGEFULLLINECOUNT - 3 THEN
  1544.     BEGIN
  1545.       NEWPAGE;
  1546.       PAGETITLE;
  1547.     END;
  1548. END;
  1549. Modify  the source code to position the title "SUB TOTAL :".  Now
  1550. examine  the  code  which  is used to  edit  a  value  stored  in
  1551. SUBTOTAL[N]  and print the answer :
  1552.   ANS := EDITNBR(SUBTOTAL[5],10,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1553.    \        \         \    \   \ \  \
  1554.     \        \         \    \   \ \  \__ EDIT CHARACTER, EITHER "$"
  1555.      \        \         \    \   \ \     OR SPACE, PLACED BEFORE
  1556.       \        \         \    \   \ \    PRINTED NUMERIC VALUE.
  1557.        \        \         \    \   \ \__ NUMBER OF DIGITS AFTER THE
  1558.         \        \         \    \   \    DECIMAL POINT.
  1559.          \        \         \    \   \__ WIDTH OF THE NUMERIC FIELD
  1560.           \        \         \    \
  1561.            \        \         \    \____ FIELD NUMBER OF DATA.
  1562.             \        \         \
  1563.              \        \         \___ NAME OF VARIABLE TO BE EDITED.
  1564.               \        \
  1565.                \        \__ PASCAL FUNCTION TO EDIT NUMBER, ADD $
  1566.                 \           AND COMMAS AND PLACE RESULT IN AN ASCII
  1567.                  \          FIELD OF A SPECIFIED LENGTH.
  1568.                   \
  1569.                    \__ ASCII STRING TO HOLD RESULT OF EDIT.
  1570.  
  1571.   WRITE (LST,ANS);
  1572. Using  a  similar pattern of instructions,  modify  the  code  to
  1573. output all the desired subtotals.
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.                                24
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.   To  customize the GRAND TOTALS,  find the source code  for  the
  1590. following PASCAL CODE :
  1591. {================================================================}
  1592. {                 PROCEDURE PRINT GRAND TOTALS                   }
  1593. {================================================================}
  1594. PROCEDURE PRINTGRANDTOTALS;
  1595. BEGIN
  1596.   WRITELN(LST,'                                  ============   ==========');
  1597.   WRITE(LST,'GRAND TOTAL :                    ');
  1598.   ANS := EDITNBR(GRANDTOTAL[5],13,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1599.   WRITE (LST,ANS);
  1600.   ANS := EDITNBR(GRANDTOTAL[6],13,1,' ');   { SUB TOTAL FOR ACCOUNT 2 }
  1601.   WRITELN(LST,ANS);
  1602. END;
  1603. Customizing  GRAND TOTALS is identical in form to customizing the
  1604. SUB TOTALS, as explained above.
  1605.  
  1606.  
  1607. Subtotals  are  printed when the contents of a  designated  field
  1608. change  in contents.  For example,  if it was desired to  have  a
  1609. subtotal  printed  every time the NAME in FIELD 1 changed  it  is
  1610. necessary  to set two lines of code.  First,  it is necessary  to
  1611. initialize  the contents of a comparison field so that we do  not
  1612. do  a SUB TOTAL at the beginning of the report.  Find the  source
  1613. code which contains the following :
  1614.  
  1615. {================================================================}
  1616. {                  OUTPUT CODE GOES HERE                         }
  1617. {================================================================}
  1618. BEGIN
  1619.  
  1620.   INITIALIZE;                   { ID AND READ IN FILE PARAMETERS }
  1621.  
  1622.   PAGE := 1;                             { INITIALIZE FOR REPORT }
  1623.   LINE := 1;
  1624.   PAGEFULLLINECOUNT := 60;
  1625.   DATARECORD := 1;                      { SET UP SUB TOTAL TEST }
  1626.   MOVERECORDDATATOARRAY;
  1627.   PREVCONTENTS := ASCIIFIELD[1];
  1628. Modify  the contents of the last line of code to insert the field
  1629. number that will be used for comparison  purposes.  ASCIIFIELD[1]
  1630. is  the  correct comparison field if we wish to have  SUB  TOTALS
  1631. every time the NAME changes.
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.                                25
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655. Second,  it is necessary to modify the line of code that actually
  1656. tests  to  see  if the field has changed and then  call  the  SUB
  1657. TOTALS  PROCEDURE if it has.  Find the SOURCE CODE which contains
  1658. the following:
  1659.   {==============================================================}
  1660.   {                 PROCESS BODY OF REPORT                       }
  1661.   {==============================================================}
  1662.  
  1663.   FOR DATARECORD := 1 TO NBRRECUSED DO
  1664.     BEGIN
  1665.       MOVERECORDDATATOARRAY;
  1666.       {========================================}
  1667.       {   CHECK TO SEE IF SUB TOTAL IS REQD    }
  1668.       {========================================}
  1669.       IF ASCIIFIELD[1] <> PREVCONTENTS THEN
  1670.         BEGIN
  1671.           PREVCONTENTS := ASCIIFIELD[1];
  1672.           PRINTSUBTOTALS;
  1673.         END;
  1674. Modify the IF statement above so that the field designated refers
  1675. to the field  which controls the SUB TOTAL. In this case the code
  1676. "IF ASCIIFIELD[1] <> PREVCONTENTS THEN..." is correct.
  1677.  
  1678.   To  customize  the body of the report where the data  from  the
  1679. FILER  FILE  is  actually printed,  find  the  source  code  that
  1680. contains the following :
  1681.  
  1682.       {========================================}
  1683.       {       WRITE LINE OF DATA HERE          }
  1684.       {========================================}
  1685.       WRITE(LST,ASCIIFIELD[1],' ',ASCIIFIELD[2],'                ');
  1686.       ANS := EDITNBR(NUMFIELD[5],10,2,'$');   { ACCOUNT 1 }
  1687.       WRITE(LST,ANS);
  1688.       ANS := EDITNBR(NUMFIELD[6],13,1,' ');   { ACCOUNT 2 }
  1689.       WRITELN(LST,ANS);
  1690.  
  1691. This  code  outputs  the contents of ASCII FIELDS NUMBER  1  &  2
  1692. followed by edited numeric data from NUMERIC FIELDS NUMBER 5 & 6.
  1693. NUMERIC FIELD 5 is displayed in a field 10 characters wide with 2
  1694. digits  after the decimal point and a leading $.  NUMERIC FIELD 6
  1695. is  displayed in a field 13 characters wide,  with 1 digit  after
  1696. the  decimal point and with no dollar sign.  (See the  discussion
  1697. under SUB TOTALS for additional information on the functioning of
  1698. the EDITNBR function). Use a similar pattern of code to customize
  1699. the report to display the desired information.
  1700.  
  1701.   This  concludes the steps required to generate a custom report.
  1702. EXIT  the TURBO PASCAL EDITOR,  compile the program  as  detailed
  1703. previously and you have powerful customized output program.
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.                                26
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.                         TRANSFER PROGRAM
  1722.                         ================
  1723.  
  1724.   The  TRANSFER  PROGRAM permits the transfer of data within  one
  1725. FILER  FILE  to  a  second  FILER  FILE  with  a  different  file
  1726. organization. Data in a record is transferred on a field by field
  1727. basis  from the source FILER FILE to the DESTINATION FILER  FILE.
  1728. Where  data  is  transferred between fields with  differing  data
  1729. formats, data is converted to the new data format and inserted in
  1730. the  field.  At the conclusion of the program,  the SOURCE  FILER
  1731. FILE is left unchanged and the DESTINATION FILER FILE is expanded
  1732. to contain the translated data.
  1733.  
  1734.   Before the TRANSFER PROGRAM can be used,  both the SOURCE FILER
  1735. FILE and the DESTINATION FILER FILE must be created and  resident
  1736. on the disk with the TRANSFER PROGRAM. The DESTINATION FILER FILE
  1737. should  preferably be empty although this is not  mandatory.  The
  1738. empty  DESTINATION  FILER  FILE can be easily  created  from  the
  1739. SOURCE  FILER  FILE  with  the  use  of  the  programs  DATTOPIC,
  1740. PICTOFRM,  FRMTODAT,  and  any  convenient WORD EDITOR  that  can
  1741. produce  clean text.  Refer to the documentation on each of these
  1742. programs.
  1743.  
  1744.   At the start the program will display
  1745.  
  1746.  
  1747. TRANSFER A LA PASCAL
  1748. ENTER SOURCE FILE NAME : ________
  1749. ENTER DESTINATION FILE NAME : _________
  1750.  
  1751. Enter the name of the older FILER FILE that contains the data you
  1752. wish  to  transfer  after the request for the SOURCE  FILE  NAME.
  1753. Entry of the file extension '.dat' is optional. Enter the name of
  1754. the  new FILER FILE that you wish to transfer data to  after  the
  1755. request  for  the DESTINATION FILE NAME.  Again the extension  is
  1756. optional.  Transfer  will open both files and display  the  field
  1757. labels  and a field label number of the DESTINATION FILER FILE on
  1758. the screen:
  1759.  
  1760.  
  1761. NAME  = 1                          ACCOUNT REC = 7
  1762. ADDR1 = 2                          AMT PAST DUE = 8
  1763. ADDR2 = 3
  1764. CITY  = 4
  1765. STATE = 5    ZIPCODE = 6
  1766.  
  1767.  
  1768. NAME OF SOURCE FIELD TO BE TRANSLATED  : NAME
  1769. ENTER DESTINATION FIELD NUMBER (ABOVE) : 1
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.                                27
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787. THE TRANSFER SCREEN :
  1788.  
  1789.  
  1790. NAME  = 1                          ACCOUNT REC = 7
  1791. ADDR1 = 2                          AMT PAST DUE = 8
  1792. ADDR2 = 3
  1793. CITY  = 4
  1794. STATE = 5    ZIPCODE = 6
  1795.  
  1796.  
  1797. NAME OF SOURCE FIELD TO BE TRANSLATED  : NAME
  1798. ENTER DESTINATION FIELD NUMBER (ABOVE) : 1
  1799.  
  1800. In  this  example,  the DESTINATION FILER FILE differs  from  the
  1801. SOURCE FILER FILE only in that the fields for AREA CODE and PHONE
  1802. have been eliminated. The name of the SOURCE FIELDS are displayed
  1803. in  succession  on line 23 of the screen.  Line 24  provides  the
  1804. means  of  entering the field number where data from  the  SOURCE
  1805. FIELD will ultimately be stored.  In the screen displayed  above,
  1806. the  number  '1'  would be entered so that data from  the  SOURCE
  1807. FIELD 'NAME' will be transferred to the DESTINATION FIELD 'NAME'.
  1808. If  a  RETURN is depressed without entering data or if a  '0'  is
  1809. entered, no data will be transferred to the DESTINATION FIELD. If
  1810. a '-' is entered,  the screen will display the previous field for
  1811. entry.  When  all of the SOURCE FILE fields have been  displayed,
  1812. the screen will clear and a TRANSLATION TABLE will be displayed :
  1813.  
  1814. OLD      NEW       OLD LABEL  ==>  NEW LABEL
  1815. FLD #    FLD #
  1816.  
  1817.   1  ===>  1   |   NAME    ===>   NAME
  1818.   2  ===>  2   |   ADDR1   ===>   ADDR
  1819.   3  ===>  3   |   ADDR2    ===>   ADDR2
  1820.   4  ===>  4   |   CITY     ===>   CITY
  1821.   5  ===>  5   |   STATE    ===>   STATE
  1822.   6  ===>  6   |   ZIPCODE   ===>   ZIPCODE
  1823.   7  ===>  0   |   AREA CODE  ===>                 { NO DATA
  1824.   8  ===>  0   |   PHONE NBR  ===>                 { TRANSFERRED
  1825.   9  ===>  9   |   ACCOUNT REC  ===>   ACCOUNT REC
  1826.  10  ===> 10   |   AMT PAST DUE  ===>   AMT PAST DUE
  1827.  
  1828. IS TRANSFER TABLE OK (Y/N) :
  1829.  
  1830. A  response other than 'Y' will cause the process of defining the
  1831. transfer  fields to begin again.  A 'Y' response will  cause  the
  1832. program  to  continue and ask if a printed copy of the  table  is
  1833. desired. A 'Y' response will cause the table to be printed.
  1834.  
  1835. After the TRANSFER TABLE has been defined, Transfer will read all
  1836. records  from the SOURCE FILER FILE and transfer data on a  field
  1837. by field basis in accordance with the transfer table.  During the
  1838. actual  transfer,  the screen will display the number of  records
  1839. transferred.
  1840.  
  1841.  
  1842.  
  1843.  
  1844.                                28
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.                   FILER PROGRAMMING INFORMATION
  1854.                   =============================
  1855.  
  1856.   INFORMATION  ON THE STRUCTURE OF ANY FILER FILE IS CONTAINED IN
  1857. THE  FIRST  896  BYTES  OF  THE  RECORD.  A  DEBUG  DUMP  OF  THE
  1858. ACCTREC.DAT FILE GIVES THE FOLLOWING DATA:
  1859.  
  1860. 0100  00 01 06 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1861. 0110  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1862. 0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1863. 0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1864. 0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1865. 0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1866. 0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1867. 0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1868.  
  1869. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  1870. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85
  1871. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  1872. 01B0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1873. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  1874. 01D0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1875. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  1876. 01F0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1877.  
  1878. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  1879. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  1880. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE
  1881. 0230  50 48 4F 4E 45 20 4E 42-52 20 41 43 43 4F 55 4E   PHONE NBR ACCOUN
  1882. 0240  54 20 52 45 43 20 41 4D-54 20 50 41 53 54 20 44   T REC AMT PAST D
  1883. 0250  55 45 20 00 00 00 00 00-00 00 00 00 00 00 00 00   UE .............
  1884. 0260  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1885. 0270  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1886. 0280  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1887. 0290  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1888. 02A0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1889. 02B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1890. 02C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1891. 02D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1892. 02E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1893. 02F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1894.  
  1895. 0300  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1896. 0310  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1897. 0320  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1898. 0330  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1899. 0340  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1900. 0350  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1901. 0360  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1902. 0370  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1903.  
  1904.                        CONTINUED NEXT PAGE
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.                                29
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  1920. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  1921. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  1922. 03B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1923. 03C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1924. 03D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1925. 03E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1926. 03F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1927.  
  1928. 0400  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1929. 0410  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1930. 0420  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1931. 0430  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1932. 0440  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1933. 0450  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1934. 0460  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1935. 0470  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1936.  
  1937.  
  1938. DATA  STORED  BY THE FILER PROGRAM IN  ACCTREC.DAT  FOLLOWS  THE
  1939. FIRST  896 BYTES SHOWN ABOVE.  ACTUAL DATA STORED IN THE FILES IS
  1940. SHOWN BELOW :
  1941.  
  1942. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  1943. 0490  20 20 20 20 4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  1944. 04A0  56 45 52 49 4E 47 53 20-31 30 32 32 32 20 45 20   VERINGS 10222 E
  1945. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E 54 52 4F 59   TEN MILE RD.TROY
  1946. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20 4E 54 31                NT1
  1947. 04D0  32 33 34 35 32 31 32 31-32 33 34 35 36 37 20 20   23452121234567
  1948. 04E0  20 31 30 31 2E 31 32 20-20 20 20 20 30 2E 30 30    101.12     0.00
  1949. 04F0  54 48 4F 4D 41 53 20 46-2E 20 53 4D 49 54 48 20   THOMAS F. SMITH
  1950.  
  1951. 0500  20 20 20 20 54 52 49 4E-49 54 59 20 43 4F 52 50       TRINITY CORP
  1952. 0510  4F 52 41 54 49 4F 4E 20-33 30 38 30 30 20 45 41   ORATION 30800 EA
  1953. 0520  53 54 20 53 49 44 45 20-44 52 2E 20 53 55 4E 20   ST SIDE DR. SUN
  1954. 0530  43 49 54 59 20 20 20 20-20 20 20 20 20 41 52 38   CITY         AR8
  1955. 0540  33 38 33 32 37 32 38 31-32 33 34 34 35 35 20 20   38327281234455
  1956. 0550  20 32 31 30 2E 30 30 20-20 20 20 31 35 2E 30 30    210.00    15.00
  1957. 0560  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1958. 0570  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  1959.  
  1960. 0580  53 54 55 41 52 54 20 53-2E 20 57 49 4E 44 53 4C   STUART S. WINDSL
  1961. 0590  4F 57 20 20 47 52 4F 57-20 52 49 54 45 20 47 52   OW  GROW RITE GR
  1962. 05A0  45 45 4E 48 4F 55 53 45-31 32 33 20 41 4D 45 52   EENHOUSE123 AMER
  1963. 05B0  49 43 41 4E 20 52 4F 41-44 20 20 20 42 4C 4F 4F   ICAN ROAD   BLOO
  1964. 05C0  4D 49 4E 47 54 4F 4E 20-20 20 20 20 20 4E 4A 30   MINGTON      NJ0
  1965. 05D0  31 32 33 34 33 38 31 31-32 33 34 35 36 37 20 20   12343811234567
  1966. 05E0  20 20 20 30 2E 30 30 20-20 20 20 20 30 2E 30 30      0.00     0.00
  1967.  
  1968. OTHER  DATA  ENTRIES WOULD BE APPENDED TO THIS DATA IN  A  MANNER
  1969. SIMILAR TO THE ENTRIES ABOVE.
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                30
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985. THE FIRST 128 BYTES OF THE ACCTREC.DAT :
  1986.  
  1987. 0100  00 01 06 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1988. 0110  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1989. 0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1990. 0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1991. 0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1992. 0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1993. 0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1994. 0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1995.  
  1996. THIS  BLOCK OF DATA IS REQUIRED TO MAINTAIN COMPATIBILITY OF  THE
  1997. FILER  PROGRAMS WITH DATAFILES CREATED UNDER AN  EARLIER  VERSION
  1998. WRITTEN  IN BASIC-Z.  THE SECOND AND THIRD BYTES ARE UTILIZED  BY
  1999. BASIC-Z  TO STORE THE LENGTH OF THE FILE.  FOR VERSIONS OF  FILER
  2000. WRITTEN IN TURBO PASCAL, THESE FIRST 128 BYTES ARE NOT UTILIZED.
  2001.  
  2002.  
  2003. THE NEXT 128 BYTES OF ACCTREC.DAT CONTAIN A FILE NAME, NUMBER OF
  2004. RECORDS USED,  RECORD LENGTH,  BLOCKING FACTOR,  NUMBER OF FIELDS
  2005. PER  RECORD,  DATE OF LAST DATA ENTRY,  THE LENGTH OF EACH OF THE
  2006. FIELD LABELS, THE LENGTH OF EACH OF THE DATA FIELDS, AND THE DATA
  2007. TYPE FOR EACH FIELD :
  2008.  
  2009. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2010. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85
  2011. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  2012. 01B0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2013. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  2014. 01D0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2015. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  2016. 01F0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2017.  
  2018. FILE NAME, NUMBER OF RECORD USED :
  2019. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2020.       ================= =========== =========== =====
  2021.              \               \           \
  2022.               \               \           \___"   5" =  NBR RECORDS USED
  2023.                \               \
  2024.                 \               \___ "0000"  =  THIS FIELD NOT USED
  2025.                  \
  2026.                   \__ "ACCTR" = FIRST 6 LETTERS OF FILE NAME USED WHEN
  2027.                                  FILE WAS CREATED.
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.                                31
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051. RECORD SIZE, BLOCKING FACTOR, NBR FIELDS/RECORD, DATE LAST ENTRY :
  2052. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2053.                                                 =====
  2054.  
  2055. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85
  2056.       == ===== ===== ======================= ========
  2057.       \    \     \              \                \
  2058.        \    \     \              \                \__ "   " = NOT USED
  2059.         \    \     \              \
  2060.          \    \     \              \__ "05/23/85" = DATE OF LAST DATA
  2061.           \    \     \                              ENTRY TO FILE.
  2062.            \    \     \
  2063.             \    \     \__ "10" = NUMBER OF FIELDS IN EACH RECORD.
  2064.              \    \
  2065.               \    \__ "02" = BLOCKING FACTOR ( NUMBER OF RECORDS THAT
  2066.                \              CAN BE HELD IN A 256 BYTE BLOCK OF DATA )
  2067.                 \
  2068.                  \__ "112" = NUMBER OF BYTES IN EACH RECORD.
  2069.  
  2070.  
  2071. LENGTH OF LABEL FOR EACH FIELDS :
  2072. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  2073.       == == == == == == == == == ==
  2074.        \  \                    \  \
  2075.         \  \    <== ETC ==>     \  \__ "13" = 13 BYTES LENGTH FOR LABEL
  2076.          \  \                    \            "AMT PAST DUE "
  2077.           \  \                    \__ "12" = 12 BYTES LENGTH FOR LABEL
  2078.            \  \                              "ACCOUNT REC "
  2079.             \  \__ "06" = 6 BYTE LENGTH FOR LABEL "ADDR1 "
  2080.              \__ "06" = 6 BYTE LENGTH FOR LABEL "NAME "
  2081.  
  2082.  
  2083. LENGTH OF EACH DATA FIELD "
  2084. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  2085.       == == == == == == == == == ==
  2086.        \  \                    \  \
  2087.         \  \                    \  \__ "09" = 9 BYTES REQUIRED TO STORE
  2088.          \  \     <== ETC ==>    \            DATA FOR FIELD 10 WHOSE
  2089.           \  \                    \           PICTURE IS "123,456.78".
  2090.            \  \                    \          ( COMMAS ARE NOT STORED )
  2091.             \  \                    \__ "09" = 9 BYTES REQUIRED TO STORE
  2092.              \  \                              DATA FOR FIELD 9.
  2093.               \  \__ "20" = 20 BYTES REQUIRED TO STORE DATA FOR FIELD 1.
  2094.                \__ "20" = 20 BYTES REQUIRED TO STORE DATA FOR FIELD 2.
  2095.  
  2096.  
  2097. DATA TYPE (ASCII OR NUMERIC & NUMBER OF DIGITS AFTER DECIMAL POINT :
  2098. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  2099.       == == == == == == == == == ==
  2100.                             \     \__ "32" = NUMERIC VALUE WITH TWO
  2101.      <== "3F" IS ALPHA ==>   \               DIGITS AFTER THE DECIMAL
  2102.                               \              POINT.
  2103.                                \__ "3F" = ALPHA DATA.
  2104. VALUES OF "30" TO "3E" ARE NUMERIC VALUES WITH THE HEX VALUE OF THE SECOND
  2105. DIGIT DETERMINING THE NUMBER OF DECIMAL DIGITS AFTER THE DECIMAL POINT.
  2106.  
  2107.  
  2108.                                32
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117. THE NEXT 384 BYTES ARE USED TO STORE THE LABELS FOR THE FIELDS IN
  2118. THE RECORD :
  2119.  
  2120. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  2121. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  2122. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE
  2123. 0230  50 48 4F 4E 45 20 4E 42-52 20 41 43 43 4F 55 4E   PHONE NBR ACCOUN
  2124. 0240  54 20 52 45 43 20 41 4D-54 20 50 41 53 54 20 44   T REC AMT PAST D
  2125. 0250  55 45 20 00 00 00 00 00-00 00 00 00 00 00 00 00   UE .............
  2126. 0260  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2127. 0270  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2128. 0280  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2129. 0290  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2130. 02A0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2131. 02B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2132. 02C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2133. 02D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2134. 02E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2135. 02F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2136.  
  2137. 0300  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2138. 0310  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2139. 0320  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2140. 0330  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2141. 0340  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2142. 0350  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2143. 0360  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2144. 0370  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2145.  
  2146.  
  2147. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  2148.       ================= ================= ===========
  2149.               |                 |               |
  2150.             NAME              ADDR1           ADDR
  2151.  
  2152. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  2153.       ===== ================= ================= =====
  2154.         |           |                  |          |
  2155.         2         CITY               STATE       ZI
  2156.  
  2157. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE
  2158.       ================= ============== ==============
  2159.               |                |              |
  2160.             PCODE             AREA          CODE
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.                                33
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183. THE  NEXT 128 BYTES ARE USED TO STORE SCREEN  FORMAT  INFORMATION
  2184. FOR EACH FIELD.  DATA FOR EACH FIELD'S ROW AND COLUMN LOCATION IS
  2185. HELD IN A 4 BYTE GROUP.
  2186.  
  2187. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2188. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  2189. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  2190. 03B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2191. 03C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2192. 03D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2193. 03E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2194. 03F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2195.  
  2196.  
  2197. SCREEN INFORMATION :
  2198. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2199.       =========== =========== =========== ===========
  2200.                        |
  2201.                        |
  2202.                   RR CC C  FF
  2203.                   == == == ==
  2204.                    \  \  \  \__ FIELD NUMBER ( NOT USED )
  2205.                     \  \  \
  2206.                      \  \__\___ COLUMN NUMBER
  2207.                       \
  2208.                        \_______ ROW NUMBER
  2209.  
  2210.  
  2211. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2212.                   == ====  ==
  2213.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2214.                     \   \
  2215.                      \   \__ "001" = COLUMN NBR 1
  2216.                       \
  2217.                        \____ "01" = ROW NBR 1
  2218.  
  2219.  
  2220. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  2221.                   == ====  ==
  2222.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2223.                     \   \
  2224.                      \   \__ "001" = COLUMN NBR 1
  2225.                       \
  2226.                        \____ "05" = ROW NBR 5
  2227.  
  2228.  
  2229. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  2230.                   == ====  ==
  2231.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2232.                     \   \
  2233.                      \   \__ "036" = COLUMN NBR 36
  2234.                       \
  2235.                        \____ "01" = ROW NBR 1
  2236.  
  2237.  
  2238.  
  2239.  
  2240.                                34
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249. DATA  STORED  BY THE FILER PROGRAM IN  ACCTREC.DAT  FOLLOWS  THE
  2250. FIRST  896 BYTES SHOWN ABOVE.  ACTUAL DATA STORED IN THE FILES IS
  2251. SHOWN BELOW :
  2252.  
  2253. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  2254. 0490  20 20 20 20 4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  2255. 04A0  56 45 52 49 4E 47 53 20-31 30 32 32 32 20 45 20   VERINGS 10222 E
  2256. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E 54 52 4F 59   TEN MILE RD.TROY
  2257. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20 4E 54 31                NT1
  2258. 04D0  32 33 34 35 32 31 32 31-32 33 34 35 36 37 20 20   23452121234567
  2259. 04E0  20 31 30 31 2E 31 32 20-20 20 20 20 30 2E 30 30    101.12     0.00
  2260. 04F0  54 48 4F 4D 41 53 20 46-2E 20 53 4D 49 54 48 20   THOMAS F. SMITH
  2261.  
  2262. 0500  20 20 20 20 54 52 49 4E-49 54 59 20 43 4F 52 50       TRINITY CORP
  2263. 0510  4F 52 41 54 49 4F 4E 20-33 30 38 30 30 20 45 41   ORATION 30800 EA
  2264. 0520  53 54 20 53 49 44 45 20-44 52 2E 20 53 55 4E 20   ST SIDE DR. SUN
  2265. 0530  43 49 54 59 20 20 20 20-20 20 20 20 20 41 52 38   CITY         AR8
  2266. 0540  33 38 33 32 37 32 38 31-32 33 34 34 35 35 20 20   38327281234455
  2267. 0550  20 32 31 30 2E 30 30 20-20 20 20 31 35 2E 30 30    210.00    15.00
  2268. 0560  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  2269. 0570  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20
  2270.  
  2271.  
  2272.  
  2273. BREAKDOWN OF FIELDS IN FIRST RECORD :
  2274.  
  2275. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  2276. 0490  20 20 20 20
  2277.  
  2278. 0490              4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  2279. 04A0  56 45 52 49 4E 47 53 20-                          VERINGS
  2280.  
  2281. 04A0                         -31 30 32 32 32 20 45 20   VERINGS 10222 E
  2282. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E               TEN MILE RD.
  2283.  
  2284. 04B0                                      54 52 4F 59               TROY
  2285. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20
  2286.  
  2287. 04C0                                         4E 54                   NT
  2288.  
  2289. 04C0                                               31                  1
  2290. 04D0  32 33 34 35                                       2345
  2291.  
  2292. 04D0              32 31 32                                  212
  2293.  
  2294. 04D0                       31-32 33 34 35 36 37                1234567
  2295.  
  2296. 04D0                                            20 20
  2297. 04E0  20 31 30 31 2E 31 32                               101.12
  2298.  
  2299. 04E0                       20-20 20 20 20 30 2E 30 30               0.00
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.                                35
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325. (***************************************************************)
  2326. (*                                                             *)
  2327. (*        FILER A LA PASCAL DATA BASE SOURCE CODE FILE         *)
  2328. (*                                                             *)
  2329. (*        (C) 1985 by  John M. Harlan                          *)
  2330. (*                     24000 Telegraph                         *)
  2331. (*                     Southfield, MI. 48034                   *)
  2332. (*                                                             *)
  2333. (*     The FILER GROUP of programs is released on a "FREE      *)
  2334. (*     SOFTWARE" basis.  The recipient is free to examine      *)
  2335. (*     and use the software with the understanding that if     *)
  2336. (*     the FILER GROUP of programs prove to be of use and      *)
  2337. (*     value,  a contribution to the author is encouraged.     *)
  2338. (*                                                             *)
  2339. (*     While reasonable effort has been made to ensure the     *)
  2340. (*     reliability of the FILER GROUP of programs, no war-     *)
  2341. (*     ranty is given. The recipient uses the programs at      *)
  2342. (*     his own risk  and in no event shall the author be       *)
  2343. (*     liable for damages arising from their use.              *)
  2344. (*                                                             *)
  2345. (*                                                             *)
  2346. (***************************************************************)
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.                                36
  2373.